package context;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringContext {
    private ApplicationContext context;
    private static SpringContext springContext;

   private SpringContext(){
       context = new ClassPathXmlApplicationContext("spring-context.xml");
   }

   public static SpringContext getInstance(){
       if (springContext==null){
           synchronized (SpringContext.class){
               if (springContext==null){
                   springContext = new SpringContext();
               }
           }
       }
       return springContext;
   }

   public ApplicationContext getContext(){
       return  context;
   }

}
